package org.linlinjava.litemall.brand.service;

import org.linlinjava.litemall.db.dao.ServicePermissionMapper;
import org.linlinjava.litemall.db.domain.ServicePermission;
import org.linlinjava.litemall.db.domain.ServicePermissionExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @description:  商户  ServicePermission 表是 商户角色  后台角色
 * @program: mall
 * @author: youvy
 * @create: 2019-12-10 15:27
 **/
@Service
public class BrandPermissionService {
	@Resource
	ServicePermissionMapper mapper;

	public List<ServicePermission> findByRoleId(int role,int mType, int pType) {
		ServicePermissionExample example = new ServicePermissionExample();
		example.or().andRoleIdEqualTo(role).andMTypeEqualTo(mType).andPTypeEqualTo(pType);
		return mapper.selectByExample(example);
	}
}
